<template>
	<view v-if="chat_checked" style="height: 120rpx;">

		<view class="bottom-edit">
			<view class="flex flex-y-center">
				<!-- <view class="flex flex-d-c flex-x-y mr-20" @tap.stop="collect">
					<image style="width: 40rpx;height:40rpx" src="../../static/chat/msg/edit3.png"></image>
					<view class="mt-10">
						收藏
					</view>
				</view> -->
				<view class="flex flex-d-c flex-x-y" style="margin-left: 20rpx;" @tap.stop="send">
					<view class="iconfont icon-zhuanfa fs-40  color-666666"></view>
					<view class="fs-26 color-666666">
						转发
					</view>
				</view>
				<view v-if="app_chat_type != 'all'" class="flex flex-d-c flex-x-y" style="margin-left: 60rpx;" @tap.stop="del">
					<view class="iconfont icon-icon_del fs-40 color-666666"></view>
					<view class=" fs-26 color-666666">
						删除
					</view>
				</view>
				<view class="flex flex-d-c flex-x-y" style="margin-left: 60rpx;" @tap.stop="close">
					<view class="iconfont icon-guanbi- fs-34 color-666666"></view>
					<view class="fs-26 color-666666">
						取消
					</view>
				</view>
			</view>
		</view>

		<toast ref="toast"></toast>

	</view>
</template>

<script>
	export default {
		name: "multipleChoiceEdit",
		data() {
			return {
				bottom: 0,
			};
		},
		props: {
			// del:{
			// 	type: Function,
			// 	default: ()=>{}
			// }
		},
		computed: {
			app_chat_type() {
				return this.$store.state.app_chat_type;
			}
		},
		destroyed() {
			this.close();
		},
		methods: {
			close() {
				this.vuexSet('chat_checked', false);
			},
			collect() {
				console.log('collect')
			},
			send() {
				if (this.chat_checked_arr.length == 0) return
				// this.click(() => {
				// 	this.toPage(`/pages/chat/selectChat?title=转发消息&type=tofriend&sure_text=确定&handleSure=send`);
				// });
			},
			del() {
				this.request({
					url: '/chat/delMessageLog',
					method: 'POST',
					data: this.chat_checked_arr
				}).then(res => {
					if (res.status != 200) return
					this.$refs.toast.open({
						title: '是否确定删除此条聊天记录',
						success: () => {
							this.$emit('deleteMsg', this.chat_checked_arr.map(val => val.msgId))
							this.close()
						}
					})
				})
			}
		}
	}
</script>

<style lang="scss">
	.bottom-edit {
		position: fixed;
		bottom: -2rpx;
		left: 0;
		width: 100vw;
		height: 140rpx;
		transform: translateZ(0);
		z-index: 999;
		background-color: #E7E9ED;
		padding: 20rpx 40rpx;
	}

	.del-box {
		background-color: #fff;
		padding: 20rpx 0;
	}
</style>
